﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfStudy
{
    /// <summary>
    /// Interaction logic for StudyCommand.xaml
    /// </summary>
    public partial class StudyCommand : Window
    {
        public StudyCommand()
        {
            InitializeComponent();
        }

        public void MyCmd_CanExecute(object target, CanExecuteRoutedEventArgs e)
        {
            e.CanExecute = true;
        }

        public void MyCmd_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            bool flag = (bool)e.Parameter;
            if (flag)
            {
                string str1 = e.Source.ToString();
                MessageBox.Show(str1);
            }
            else
            {
                string str2 = e.OriginalSource.ToString();
                MessageBox.Show(str2);
            }
        }

    }
}
